import request from '@/utils/request'

// 查询产品列表
export function listProduct(query) {
    return request({
        url: '/product/product/list',
        method: 'get',
        params: query
    })
}

export function productNum(query) {
    return request({
        url: '/product/product/productNum',
        method: 'get',
        params: query
    })
}

// 查询产品详细
export function getProduct(id) {
    return request({
        url: '/product/product/' + id,
        method: 'get'
    })
}

// 新增产品
export function addProduct(data) {
    return request({
        url: '/product/product',
        method: 'post',
        data: data
    })
}

export function updown(data) {
    return request({
        url: '/product/product/updown',
        method: 'post',
        data: data
    })
}

export function getPrice(data) {
    return request({
        url: '/product/product/getPrice',
        method: 'post',
        data: data
    })
}

export function updateProductConfig(data) {
    return request({
        url: '/product/product/updateProductConfig',
        method: 'post',
        data: data
    })
}
export function getMinimimOrder(data) {
    return request({
        url: '/product/product/getMinimimOrder',
        method: 'post',
        data: data
    })
}

// 修改产品
export function updateProduct(data) {
    return request({
        url: '/product/product',
        method: 'put',
        data: data
    })
}

// 删除产品
export function delProduct(id) {
    return request({
        url: '/product/product/' + id,
        method: 'delete'
    })
}
